package com.example.demodubbonacosconsumer;

import org.apache.dubbo.config.annotation.Reference;
import org.example.ServiceA;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class DubboNacosController {

    // 指定interfaceClass属性时，需要在提供者端也指定interfaceClass属性
//    @Reference(version = "1.0.0",interfaceClass = ServiceA.class,cluster = "failfast")
    @Reference
    ServiceA serviceA;

    @GetMapping("/hello")
    public String sayHello(){
        return serviceA.greet("Zhang");
    }
}
